An azimuth measuring device (so-called electronic compass) is known in which magnetic sensors are arranged along two or three directions, geomagnetism is measured and an azimuth is calculated. In recent years, the azimuth measuring device has become increasingly smaller and is incorporated into a portable device such as a mobile telephone or a PDA (Personal Digital Assistant).
When a magnetized component such as a speaker is disposed near the magnetic sensor, the azimuth measuring device detects magnetism leaked from the magnetized component together with the geomagnetism. Thus, an azimuth is erroneously calculated unless an azimuth is determined after a signal component due to other than geomagnetism is subtracted from a measured signal. A stationary signal component due to other than geomagnetism is referred to as an offset.
A method of estimating an offset of an azimuth measuring device that is suitable for a portable device is disclosed in patent literature 1, patent literature 2 and the like. The method disclosed in patent literature 1 and 2 is a technique for estimating the offset of the azimuth measuring device incorporated in the portable device automatically and unconsciously by the user by taking advantage of the fact that the posture of the portable device is variously changed depending on the use situation of a user.
FIG. 17 is a diagram illustrating the concept of a method of estimating an offset in a conventional azimuth measuring device.
When a user freely moves an azimuth measuring device 1 under a uniform geomagnetism circumstance, geomagnetic data obtained by the azimuth measuring device 1 is distributed on the surface of a sphere in which an offset included in the data is located at the center position of the sphere. The sensitivities of measurement axes of the azimuth measuring device 1 are considered to be equal to each other.
In the present application, as described above, a component other than a vector physical quantity (for example, geomagnetism) that is included in data and that is to be measured is referred to as an offset. First, in order to estimate an offset, the center of a spherical surface (when the geomagnetism is detected by using a three-axis geomagnetic sensor) on which geomagnetic data are distributed is estimated. The center of the spherical surface is referred to as a reference point. Next, the reliability of the estimated reference point (whether the reference point is estimated within an estimation error which is allowed by a system) is examined, and thus the reference point determined to be reliable is adopted as the offset of the system. When the reliability of the reference point is not determined, the reference point is directly used as the offset of the system.
According to patent literature 1, when a three-axis measurement data obtained repeatedly by the azimuth measuring device 1 is defined as (xi, yi, zi), it is suitable to estimate a reference point (ox, oy, oz) so as to minimize an evaluation formula [Formula 1]. Here, the reference point is determined by the solution of a simultaneous linear equation shown as [Formula 2]. That is,
                                              ⁢                  S          =                                    ∑                              i                =                1                            N                        ⁢                                                                                                                      (                                                                        x                          i                                                -                                                  o                          x                                                                    )                                        2                                    -                                                            (                                                                        y                          i                                                -                                                  o                          y                                                                    )                                        2                                    +                                                            (                                                                        z                          i                                                -                                                  o                          z                                                                    )                                        2                                    -                                      r                    2                                                                              2                                                          [                  Formula          ⁢                                          ⁢          1                ]                                                      [                                                                                                      ∑                                              i                        =                        1                                            N                                        ⁢                                                                  x                        i                                            ⁡                                              (                                                                              x                            i                                                    -                                                      x                            _                                                                          )                                                                                                                                                        ∑                                              i                        =                        1                                            N                                        ⁢                                                                  y                        i                                            ⁡                                              (                                                                              x                            i                                                    -                                                      x                            _                                                                          )                                                                                                                                                        ∑                                              i                        =                        1                                            N                                        ⁢                                                                  z                        i                                            ⁡                                              (                                                                              x                            i                                                    -                                                      x                            _                                                                          )                                                                                                                                                                                    ∑                                              i                        =                        1                                            N                                        ⁢                                                                  y                        i                                            ⁡                                              (                                                                              x                            i                                                    -                                                      x                            _                                                                          )                                                                                                                                                        ∑                                              i                        =                        1                                            N                                        ⁢                                                                  y                        i                                            ⁡                                              (                                                                              y                            i                                                    -                                                      y                            _                                                                          )                                                                                                                                                        ∑                                              i                        =                        1                                            N                                        ⁢                                                                  z                        i                                            ⁡                                              (                                                                              y                            i                                                    -                                                      y                            _                                                                          )                                                                                                                                                                                    ∑                                              i                        =                        1                                            N                                        ⁢                                                                  z                        i                                            ⁡                                              (                                                                              x                            i                                                    -                                                      x                            _                                                                          )                                                                                                                                                        ∑                                              i                        =                        1                                            N                                        ⁢                                                                  z                        i                                            ⁡                                              (                                                                              y                            i                                                    -                                                      y                            _                                                                          )                                                                                                                                                        ∑                                              i                        =                        1                                            N                                        ⁢                                                                  z                        i                                            ⁡                                              (                                                                              z                            i                                                    -                                                      z                            _                                                                          )                                                                                                                  ]                    ⁡                      [                                                                                o                    x                                                                                                                    o                    y                                                                                                                    o                    z                                                                        ]                          =                              1            2                    =                      [                                                                                                      ∑                                              i                        =                        1                                            N                                        ⁢                                                                  (                                                                              x                            i                            2                                                    +                                                      y                            i                            2                                                    +                                                      z                            i                            2                                                                          )                                            ⁢                                              (                                                                              x                            i                                                    -                                                      x                            _                                                                          )                                                                                                                                                                                    ∑                                              i                        =                        1                                            N                                        ⁢                                                                  (                                                                              x                            i                            2                                                    +                                                      y                            i                            2                                                    +                                                      z                            i                            2                                                                          )                                            ⁢                                              (                                                                              y                            i                                                    -                                                      y                            _                                                                          )                                                                                                                                                                                    ∑                                              i                        =                        1                                            N                                        ⁢                                                                  (                                                                              x                            i                            2                                                    +                                                      y                            i                            2                                                    +                                                      z                            i                            2                                                                          )                                            ⁢                                              (                                                                              z                            i                                                    -                                                      z                            _                                                                          )                                                                                                                  ]                                              [                  Formula          ⁢                                          ⁢          2                ]                                                          ⁢                  Where          ,                                                                                              ⁢                                            x              _                        =                                          1                N                            ⁢                                                ∑                                      i                    =                    1                                    N                                ⁢                                  x                  i                                                              ,                                          ⁢                                    y              _                        =                                          1                N                            ⁢                                                ∑                                      i                    =                    1                                    N                                ⁢                                  y                  i                                                              ,                                          ⁢                                    z              _                        =                                          1                N                            ⁢                                                ∑                                      i                    =                    1                                    N                                ⁢                                  z                  i                                                                                        [                  Formula          ⁢                                          ⁢          3                ]            
and, N is the number of geomagnetic data obtained.
Another method of determining an offset of a sensor is disclosed in patent literature 8. According to patent literature 8, among three or more magnetic data detected by a magnetism detection unit, an intersection between a perpendicular bisector to a straight line connecting any two points and a perpendicular bisector to a straight line connecting two points different from the above-described two points is determined as an offset.
Moreover, a large number of any two points are extracted from a plurality of magnetic data, a large number of perpendicular bisectors are set for respective straight lines connecting the two points, and the average of coordinates of a plurality of intersections at which the large number of perpendicular bisectors intersect each other is determined as an offset.
In recent years, as a lightweight and small three-axis acceleration sensor that can be incorporated into a portable device, a piezoresistive three-axis acceleration sensor comprised of a semiconductor device employing MEMS (Micro Electro Mechanical Systems) technology has been developed (for example, see patent literature 7).
The acceleration sensor detects dynamic acceleration and motion acceleration. When movement is involved, the acceleration sensor can detect not only gravitational acceleration but also dynamic acceleration whereas, in a stationary state, it can detect only gravitational acceleration. The angle of inclination of the acceleration sensor can be calculated from a three-axis acceleration output of the acceleration sensor in a stationary state, and, based on this, as an application, the posture angle of a portable device incorporating the acceleration sensor is determined.
In order to determine the angle of inclination of the acceleration sensor, it is necessary to determine the value of gravitational acceleration that is applied to each axis of the acceleration sensor. Hence, it is necessary to calculate the offset of the acceleration sensor and correct it. The offset of the acceleration sensor is determined by an operation for, for example, the outgoing inspection of the factory of the acceleration sensor, the outgoing inspection of the factory of a portable device and the estimation of an offset by the user.
Patent literature 5 and 6 disclose methods for automatically and unconsciously by the user estimating the offset of an acceleration sensor. Any of these methods is a technique based on [Formula 2] and is a technique that estimates the offset with high degree of reliability by utilizing characteristic unique to acceleration.
As in the azimuth measuring device of FIG. 17, gravitational acceleration measurement data detected by the three-axis acceleration sensor is distributed on the surface of a sphere in which the offset of the acceleration sensor is located at the center position thereof. The sensitivities of measurement axes of the acceleration sensor are assumed to be equal to each other.
Since the acceleration sensor detects gravitational acceleration and motion acceleration simultaneously, the separation of the gravitational acceleration from the motion acceleration is a technical point for determining an offset with high reliability.
In patent literature 5, whether a portable terminal becomes stationary is determined from acceleration measurement data that is continuous over time, and an offset is estimated by use of only the acceleration measurement data at that time.
In patent literature 6, the probability that motion acceleration is included in the acceleration measurement data is calculated by using variations in acceleration measurement data that is continuous over time. Thus, an offset can also be estimated from measurement data including motion acceleration.